<!-- 系统自动生成 Date:2021-07-23 13:39 -->
<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="租户管理" bodyClass="gray-bg animated fadeInRight" isAnimation=false libs=["table","zTree","layout-latest"]/>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <@f.form id="tenant-form">
                <div class="select-list">
                    <ul>
                        <li>
                            <label> ${i18n("租户ID")}：</label>
                            <@f.input name="tenantId"/>
                        </li>
                        <li>
                            <label> ${i18n("租户名称")}：</label>
                            <@f.input name="tenantName"/>
                        </li>
                        <li>
                            <label> ${i18n("联系人")}：</label>
                            <@f.input name="linkman"/>
                        </li>
                        <li>
                            <label> ${i18n("状态")}： </label>
                            <@f.select name="status" dictType="sys_status" blankValue="" blankLabel="所有"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;${i18n("查询")}</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;${i18n("重置")}</a>
                            <a class="btn btn-default btn-rounded btn-sm" data-toggle="formMore"><i class="fa fa-angle-double-down"></i>&nbsp;${i18n("更多")}</a>
                        </li>
                    </ul>
                </div>
                <div class="select-list-more">
                    <ul>
                        <li>
                            <label> ${i18n("联系电话")}：</label>
                            <@f.input name="link"/>
                        </li>
                    </ul>
                </div>
            </@f.form>
        </div>
        <@table id="bootstrap-table">
            <@shiro.hasPermission name="sys:tenant:add">
                <a class="btn btn-success" onclick=" opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;${i18n("新增")}</a>
            </@shiro.hasPermission>
            <@shiro.hasPermission name="sys:tenant:edit">
                <a class="btn btn-primary single disabled" onclick=" opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;${i18n("修改")}</a>
            </@shiro.hasPermission>
            <@shiro.hasPermission name="sys:tenant:del">
                <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()"><i class="fa fa-remove"></i> ${i18n("删除")}</a>
            </@shiro.hasPermission>
        </@table>
    </div>
</div>
<@footer>
<script type="text/javascript">
    var editFlag = "${permission.hasPermi("sys:tenant:edit")}";
    var listFlag = "${permission.hasPermi("sys:tenant:add")}";
    var delFlag = "${permission.hasPermi("sys:tenant:del")}";
    var visible = ${permission.isPermitteds("sys:tenant:edit,sys:tenant:del,sys:tenant:add")?string('true', 'false')};
    var statusDatas = ${dict.getDictListJson('sys_status')};
    var prefix = baseURL + "sys/tenant";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "${i18n("租户")}",
            uniqueId:  'id',/* 唯一ID */
            escape: true,/* 分页设置 */
            showPageGo: true,/* 分页设置 */
            pageSize: 10,/* 分页设置 */
            pageList: [10, 30, 50],/* 分页设置 */
            columns:[
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '${i18n("主键")}',visible: false}
                ,{field : 'tenantId',title : '${i18n("租户ID")}'}
                ,{field : 'tenantName',title : '${i18n("租户名称")}'}
                ,{field : 'linkman',title : '${i18n("联系人")}'}
                ,{field : 'link',title : '${i18n("联系电话")}'}
                ,{field : 'address',title : '${i18n("联系地址")}'}
                ,{field : 'status',title : '${i18n("状态")}',formatter: function(value, row, index) {
                    return opt.common.selectDictLabels(statusDatas, value);
                }}
                ,{title:"${i18n("操作")}",align: 'center',visible:visible,class:'action',formatter: function(value, row, index) {
                    var actions = [];
                    actions.push('<a class="' + editFlag + '" href="javascript:void(0)" title="${i18n("编辑")}" onclick=" opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i></a> ');
                    actions.push('<a class="' + delFlag + '" href="javascript:void(0)" title="${i18n("删除")}" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></a> ');
                    return actions.join('');
                }}
            ]
        };
        $.table.init(options);
    });
</script>
</@footer>
</@pageTheme>